@isTest (SeeAllData=true)
private class OutboundEmails_TestClass {   
 // Methods for testing 
static testMethod void testMyWebSvc()
  {

      Announcement__c Ann_c = new Announcement__c();
      Ann_c.Name = 'ABC';
      insert Ann_c;
      
      A_Task__c AnnTask_c = new A_Task__c();
      AnnTask_c.Name ='ABC';
      AnnTask_c.Announcement__c = Ann_c.Id;
      insert AnnTask_c;
      
      Account Acount = new Account(name='ABC');
      insert Acount;
      
      Contact contact1 = new Contact();
      contact1.LastName = 'lastname1';
      contact1.Firstname = 'firstname1';
      contact1.email = 'elias.almanza@softtek.com';
      contact1.AccountId= Acount.Id;
      insert contact1;
      
      Profile p = [SELECT Id FROM Profile WHERE Name='Custom - Portal Employee']; 
      User Usr = new User(Alias = 'empltest', Email='elias.almanza@softtek.com', 
      EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
      LocaleSidKey='en_US', ProfileId = p.Id,  CurrencyIsoCode='USD', 
      TimeZoneSidKey='America/Los_Angeles', UserName='employeetest@softtek.com', ContactId=contact1.Id);
//      Usr.ContactId = contact1; 
      insert Usr;
      
      A_Task_User__c AnnTskUsr_c = new A_Task_User__c();
      AnnTskUsr_c.Announcement_Task__c = AnnTask_c.Id;
      AnnTskUsr_c.User__c = Usr.Id;
      insert AnnTskUsr_c;
      
      List<Announcement__c> list_a_c = [SELECT Id FROM Announcement__c WHERE Name='ABC' LIMIT 1];

//      List<Contact> contacts = [SELECT Id,firstname FROM Contact WHERE LastName = '123'];
      
      ID id_a_c = list_a_c[0].Id;
//      OutboundEmails(Announcement_Controller controller)
      Announcement_Controller sc 
            = new Announcement_Controller();
      OutboundEmails sc1=new OutboundEmails (sc); // test constructor

        // Not: sc1.SendEmail(); 
        // Because method is a webservice in a global class
      //  SendConfirmation.SendEmail(con.Id,oppNew.Id);

      OutboundEmails.SendEmailWithTemplate(id_a_c);
      
  }
}